let text = "你好";

let user = {
    name: "小明",
    age: 18,
}

function fun(obj) {
    return text + "：" + obj.name + "，年龄是：" + obj.age;
}

// 使用模板语法
function fun2(obj) {
    return `${text}：姓名是：${obj.name}，年龄是：${obj.age}`;
}

let myDom = (
    <div>
        <div>{fun(user)}</div>
        <div>{fun2(user)}</div>
    </div>
);
let root = ReactDOM.createRoot(document.getElementById("demoReact"));
root.render(myDom);